home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03120101.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  2.1 KB  |  31 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>Asc Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03120101"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         p.P2{
  7.                 }
  8.         span.T1{
  9.                 font-weight:bold;}
  10.         </style></head><body>
  11.    
  12.    
  13.    <help:to-be-embedded Eid="asc" xmlns:help="http://openoffice.org/2000/help">
  14.    <p class="Head1"><help:link Id="66545">Asc Function [Runtime]</help:link></p>
  15.    <p class="Paragraph">Returns the ASCII value (American Standard Code for Information Interchange) of the first character in a string expression.</p>
  16.    </help:to-be-embedded>
  17.    <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  18.    <p class="Paragraph">Asc (Text As String) <help:key-word value="Asc" tag="kw66545_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  19.    <p class="Paragraph"><span class="T1">Return value</span>:</p>
  20.    <p class="Paragraph">Integer</p>
  21.    <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  22.    <p class="Paragraph">Text: Any valid string expression. Only the first character in the string is relevant.</p>
  23.    <p class="Paragraph">The Asc function is often used to replace keys with values; thus more or less representing the reverse of the <span class="T1">Chr$</span> function. If a string is blank in the Asc function, <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic reports a run-time error. In addition to printable 8 bit ASCII characters (Codes 32-255), the ASCII function can also be used to detect non-printable key codes in ASCII code. In addition 16 bit unicode characters are allowed.</p>
  24.    <p class="P2">Example:</p>
  25.    <p class="PropText">Sub ExampleASC</p>
  26.    <p class="PropText">Print ASC("A") REM returns 65</p>
  27.    <p class="PropText">Print ASC("Z") REM returns 90</p>
  28.    <p class="PropText">Print ASC("Las Vegas") REM returns 76, since only the first character is taken into account</p>
  29.    <p class="PropText">End Sub</p>
  30.    <p class="PropText"/>
  31.   </body></html>